import fetch from 'utils/fetch';

export function page(query) {
  return fetch({
    // url: '/api/admin/user/page',
    url: '/api/admin/userManage/queryUserList',
    method: 'get',
    params: query
  });
}

//获取角色列表
export function fetchTree(query) {
  return fetch({
    url: '/api/admin/groupManage/tree',
    method: 'get',
    params: query
  });
}

export function fetchTreeObj(query) {
  return fetch({
    url: '/api/admin/person/tree',
    method: 'get',
    params: query
  });
}
//获取届列表
export function fetchJieOptionsObj() {
  return fetch({
    url: '/api/admin/bizSchool/getSessions',
    method: 'post'
  });
}
//获取学校列表
export function fetchSchoolListObj(obj) {
  return fetch({
    // url: '/api/admin/bizSchool/querySchool',
    url: '/api/admin/bizSchool/querySchoolAll',
    method: 'post',
    data:obj
  });
}

export function fetchAll() {
  return fetch({
    url: '/api/admin/user/all',
    method: 'get'
  });
}
export function addObj(obj) {
  return fetch({
    url: '/api/admin/user',
    method: 'post',
    data: obj
  });
}
//获取用户管理范围
export function getUserScopeObj(query) {
  return fetch({
    url: '/api/admin/bizUserScope/getUserScopeList',
    method: 'get',
    params: query
  })
}
//获取用户角色信息
export function getUserGroupObj(id) {
  return fetch({
    url: '/api/admin/user/queryUser/' + id,
    method: 'get'
  })
}
export function getObj(id) {
  return fetch({
    // url: '/api/admin/user/' + id,
    url: '/api/admin/userManage/' + id,
    method: 'get'
  })
}

export function getAreaListObj(query) {
  return fetch({
    url: '/api/admin/bizArea/getArea',
    method: 'get',
    params: query
  })
}

export function delObj(id) {
  return fetch({
    url: '/api/admin/user/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return fetch({
    // url: '/api/admin/user/updateUser',
    url: '/api/admin/userManage/updateUser',
    method: 'post',
    data: obj
  })
}

export function resetPwdObj(obj) {
  return fetch({
    url: '/api/admin/user/resetPassword',
    method: 'post',
    data: obj
  })
}
